﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.Design;
using System.ComponentModel.Design;

namespace Facebook_Graph_Toolkit {
    class CommentBoxDesigner : ControlDesigner{
        public override bool AllowResize {
            get {
                return false;
            }
        }
        CommentBox _CommentBox;
        public override void Initialize(System.ComponentModel.IComponent component) {
            _CommentBox = (CommentBox)component;
            base.Initialize(component);
        }
        public override string GetDesignTimeHtml() {
            string html = "<table width=\"650px\" cellspacing=\"7px\" style=\"background-color:#f3f3f3;font-family:Calibri;font-size:12px\"><tr>" +
        "<td rowspan=\"2\"><div style=\"width:50px;height:50px;background-color:#fff;text-align:center;font-size:44px;\">?</div></td>" +
        "<td colspan=\"2\" style=\"width:100%;height:40px;vertical-align:top;padding:3px;color:#666;background-color:#fff;border:1px solid #6294DF\">Add a comment..." +
        "</td></tr><tr style=\"color:#777\"><td>" +
            "<input type=\"checkbox\" />Post to Facebook</td><td style=\"text-align:right\">Posting as [username] " +
                "<input type=\"button\" value=\"Comment\" style=\"background-color:#355E9F; color:#fff;font-weight:700;font-size:12px;vertical-align:bottom;border:0\"/></td></tr>" +
        "</table>";
            string comment_html = "<table width=\"650px\" cellspacing=\"7px\" style=\"font-family:Calibri;font-size:12px\"><tr>" +
        "<td style=\"vertical-align:top\"><div style=\"width:50px;height:50px;background-color:#fff;text-align:center;font-size:44px;\">?</div></td>" +
        "<td style=\"width:100%;vertical-align:top;padding:3px\"><span style=\"color:#355e9f;font-weight:700;font-size:13px\">Username</span> · <span style=\"color:#777\">Network</span>" +
        "<p style=\"margin-top:10px;margin-bottom:5px\">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&#39;s standard " +
            "dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>" +
        "<span style=\"color:#355e9f\">Like · Reply</span> · <span style=\"color:#777\">Jan 1 at 00:00am</span>" +
        "</td></tr>" +
        "</table>";
            string linebreak_html = "<hr style=\"height:1px;width:650px;text-align:left;color:#ccc\"/>";
            html += "<br />";
            html += comment_html;
            html += linebreak_html;
            html += comment_html;
            html += linebreak_html;
            html += comment_html;
            html = html.Replace("650", _CommentBox.Width.ToString());
            return html;
        }
    }
}
